//
//  MSMessage.h
//  demo.mfwsdk
//
//  Created by BigPolarBear on 13-2-28.
//  Copyright (c) 2013年 mafengwo.com. All rights reserved.
//

#import <Foundation/Foundation.h>

#define MSMessageKeyMessageType     @"msg_type"
#define MSMessageKeyMessageId       @"msg_id"
#define MSMessageKeyIsRead          @"is_read"
#define MSMessageKeyMessageContent      @"msg_content"
#define MSMessageKeyMessageTimestamp    @"timestamp"
#define MSMessageKeyMessageUname    @"msg_uname"
#define MSMessageKeyMessageTitle    @"msg_title"
#define MSMessageKeyMessageIcon     @"msg_icon"

/** 消息类型：全部（只用于接口请求参数） */
#define MSMessageTypeAll    @"all"
/** 消息类型：意见反馈 */
#define MSMessageTypeFeedback   @"feedback"
/** 小小类型：系统 */
#define MSMessageTypeSystem     @"system"
/** 消息类型：活动 */
#define MSMessageTypeActivity   @"activity"


// 已读消息的缓存表（只保存消息类型和msgId）
#define msFilePathIsReadMessageList  [NSString stringWithFormat:@"%@/MSMessageListCache.plist",NSTemporaryDirectory()]
// 所有已加载的消息 added by hanxin 20130623
#define msFilePathAllMessageList    [NSString stringWithFormat:@"%@/MSAllMessageList.plist",NSTemporaryDirectory()]

@interface MSMessage : NSObject

+(MSMessage*)messageWithDictionary:(NSDictionary*)dict;

-(id)initWithMessage:(MSMessage*)message;

@property (nonatomic,readonly) BOOL    isRead;
@property (nonatomic,readonly) NSString* msgId;
@property (nonatomic,readonly) NSString* msgType;
@property (nonatomic,readonly) NSString* msgContent;
@property (nonatomic,readonly) NSString* timestamp;
@property (nonatomic, readonly)NSString* msgUname;
@property (nonatomic,readonly) NSString* msgTitle;
@property (nonatomic,readonly) NSString* msgIcon;
@property (nonatomic,readonly) NSString* url;

@property (nonatomic,retain) NSMutableDictionary* source;


-(NSComparisonResult)compareTimeStamp:(MSMessage *)otherMessage;

@end

